<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		function Rich(name,age,gender){
			this.name=name;
			this.age=age;
			this.gender=gender;
		}
		// Rich.prototype.money=["card1",'card2','card3'];

		// Rich.prototype.enjoy=function(){
		// 	alert("enjoy");
		// }

		var r1=new Rich("terry",20,"men");
        console.log(r1.constructor)

		function Poor(name,age,gender,color){
			Rich.call(this,name,age,gender);
			/*this.name=name;
			this.age=age;
			this.gender=gender;*/
			this.color=color;
		}

		/*Poor.prototype=Rich.prototype;
		Rich.prototype.constructor=Poor;*/
		Poor.prototype=new Rich();
		Poor.prototype.constructor=Poor;


		Poor.prototype.work=function(){
			alert("work----");
		}

		var p1=new Poor("tom",20,"men","black");

		console.log(p1);

		console.log(p1.money);
		console.log(p1.constructor);
		console.log(r1.constructor);













	</script>
</head>
<body>
	
</body>
</html>